class User {
    constructor(name, age = 20) {
        this.name = name
        this.age = age;
    }
    sayHellow() {
        return 'hello' + this.name
    }
    static judgeAge(age) {
        if (age > 18) {
            return '陈年人'
        }
        return '未成年人'
    }
}
let zhangSan = new User('zhangsan')
console.log(zhangSan)
console.log(zhangSan.sayHellow())
console.log(User.judgeAge());

class Lisi extends User {
    constructor() {
            super('lisi', 30)
        }
        // sayHellow(){
        //     console.log('你好。')
        // }

}
let lisi = new Lisi('李四', 25)
console.log(lisi)
console.log(lisi.sayHellow())
console.log(Lisi.judgeAge())